<template>
  <section>
    <div class="custorm--modelbox bgimg-edit">
      <renohome-right-nav :custormItemData="custormItemData" :isPostor="true" @rightNavChange="rightNavChange"></renohome-right-nav>
      <section v-if="nrActive">
        <div class="es-form-item">
          <div class="item">
              <i class="el-icon-circle-close  delete-child" @click="custormItemData.params.thumb.file_path = 'default_banner.png'"></i>
              <div class="item-inner "><span class="labeltext">图片</span>
                <div typetext="图片" show="0" class="small" style="align-self: start;">
                  <div class="uploadSource solid"><i class="delete ivu-icon iconfont icon-input_clear" style="font-size: 16px;"></i>
                    <div class="img" @click="uploadtoggle('image')" :style="{'background-image':`url(${getPath(custormItemData.params.thumb.file_path)})`,'height':'50px','background-repeat':'no-repeat','background-size':'cover','background-position':'50%'}"></div>
                  </div>
                </div>
              </div>
          </div>
        </div>
        <div class="edit-form-item" v-if="custormItemData.style.display == '1'">
          <div class="form-label">边角样式</div>
          <el-radio-group v-model="custormItemData.style.border">
            <el-radio label="">直角</el-radio>
            <el-radio label="radius">圆角</el-radio>
            <el-radio label="circle">圆</el-radio>
          </el-radio-group>
        </div>
      </section>
    </div>
  </section>
</template>

<script>
import defaultConfig from './utils/editConfig'
export default {
  mixins: [defaultConfig.mixins],
  props: {
    defaultConfig: {
      type: Object,
      default: function() {
        return defaultConfig
      }
    }
  },
  computed: {
  },
  methods: {
    uploadFileCallBack(files) {
      const { key } = files
      if (key === 'ChooseFiles') {
        const { displayData: [custorm] } = files
        this.custormItemData.params.thumb = custorm
      }
    },
    uploadtoggle(type) {
      this.output({ type, params: { editKey: this.custormItemData.key } })
    }
  }
}
</script>

<style lang="scss" scoped>
.custorm--modelbox.bgimg-edit {
  .es-form-item {
    border-bottom: 5px solid #f6f7f9;
    padding: 20px 23px;
    font-size: 12px;
  }

  .es-form-item .item-inner {
    margin-top: 8px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .es-form-item .item-inner:first-of-type {
    margin-top: 0;
  }

  .button-img {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    margin-right: 20px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 36px;
    text-align: center;
    border: 1px solid transparent;
  }

  .button-img.block {
    width: 100%;
    position: relative;
    min-height: 32px;
    height: auto;
    padding: 10px;
    text-align: left;
  }

  .es-title {
    margin: 12px;
    font-size: 16px;
  }

  .es-title .title-more {
    font-size: 13px;
    color: #999999;
    font-weight: normal;
  }

  .es-title,
  .es-title.title2,
  .es-title.title12,
  .es-title.title13 {
    position: relative;
  }

  .button-img .es-title {
    margin: 0;
    line-height: 1.5;
  }

  .es-title.title1 .title,
  .es-title.title12 .title,
  .es-title.title13 .title {
    padding: 0 10px;
    position: relative;
    background: #fff;
    z-index: 2;
  }

  .es-title .sub-title {
    font-size: 13px;
    color: #999999;
    font-weight: normal;
  }

  .es-title.title2 {
    .flex-row {
      align-items: baseline;
    }
    .sub-title {
      margin-left: 6px;
    }
  }

  .es-title.title3 {
    .main-title span {
      display: inline-block;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: #ffd940;
      border: 1px solid transparent;
      position: relative;
      margin: 0 10px;
    }
    .main-title span::after {
      content: " ";
      position: absolute;
      top: -2px;
      left: -2px;
      width: 5px;
      height: 5px;
      border: 1px solid #333333;
      border-radius: 50%;
    }
  }

  .ivu-input-wrapper {
    display: inline-block;
    width: 100%;
    position: relative;
    vertical-align: middle;
    line-height: normal;
  }

  .readonly-div {
    position: relative;
    flex-grow: 1;
  }

  .readonly-div .readonly input {
    background: #e8effc;
    border: 0;
    padding-left: 18px;
    cursor: pointer;
    box-sizing: border-box;
    display: inline-block;
    width: 100%;
    height: 32px;
    line-height: 1.5;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
  }
}
</style>
